#ifndef __AI_COMMON_H__
#define __AI_COMMON_H__

#include <limits.h>
/*
#define FIELD_LENGTH 125
#define ORTHO_VIEW_H 600
#define ORTHO_VIEW_L 600
#define PIXEL_PROPORTION 5
*/

// Mathematics max values
#define MAX_INT INT_MAX
#define MAX_FLOAT 3.40282347e+38F
// Security areas
#define SHOOT_CLEAN_AREA 50
#define PROXIMITY_AREA 10
#define PI 3.141592654


// Define the cols in absolute value that indicates that a robot or the ball is in that area
// The field has 2200 pixels at the large "costat"
// Half field then has 1100 pixels
// (1100 - 150)
#define Region_Col_A 950
// (1100 - 350)
#define Region_Col_B 750
// (1100)
#define Region_Goal_Left 1100
// (1100 + 150)
#define Region_Goal_Right 1250

// Define the rows that indicates that a robot or the ball is in determined area

#define Region_Top_A 1150

#define Region_Bottom_A 650

#define Region_Top_B 1300

#define Region_Bottom_B 500

// (top goal + height) = (700 + 400)
#define Region_Top_Goal 1100

#define Region_Bottom_Goal 700

#define FIELD_HEIGTH 1800
#define HALF_FIELD_HEIGTH 900
#define HALF_FIELD_LENGTH 1100

#define HALF_BALL 27
#define BALL 54
#define HALF_ROBOT 30

#define SHOOT_DISTANCE 10

#define TRUE 1
#define FALSE 0

typedef struct{
	int row;
	int col;
	int orientation;
	int robot_id;
	int linearVel;
	int angVel;
	int shooter;		//indicates if the robot is going to shoot
	int shoot_strategic; 	//indicates which strategi is used to shoot
}probot;

typedef struct {
	int row;
	int col;
    int linearVel;
    int angVel;
}pball;

typedef struct {
	probot ours[5];
	probot theirs[5];
	pball ball;
	int ownBall;	// default FALSE
	//int pos_Ball_X;
	//int pos_Ball_Y;
	int win;		// default FALSE
	int domRobotList[5]; //Set the proximity to the ball
    int domRobotListTheirs[5];
	float own_distances[5]; //Set distances to the ball of each own robot
	float theirs_distances[5]; //Set distances to the ball of each theirs robot
	int own_zones[5];
	int theirs_zones[5];
	int field; // -1, 1
	int round; // 1 , 2
	int before_round; //1, 2
	int keeperPos;
}stateGame;

typedef struct {
	// Velocities
	int vel_lin[5]; //lineal movements
	int vel_ang[5]; //angular movements
}movements;

typedef struct{
 int norm_row;
 int norm_col;
}norm_vector;


// Common used variables
//stateGame actual_state;
//movements actual_mov;

// Velocities
int MAX_LIN_VEL;
int MAX_ANG_VEL;

int processState(stateGame *state, movements *mov);

#endif
